package com.example.app.service;

import com.example.app.entity.Track;
import com.example.app.entity.TrackPoint;
import com.example.app.mapper.TrackMapper;
import com.example.app.mapper.TrackPointMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TrackService {
    @Resource
    private TrackMapper trackMapper;

    @Resource
    private TrackPointMapper trackPointMapper;

    public Track saveTrack(Track track) {
        // Implement track upload logic here
        trackMapper.insertTrack(track);
        return track;
    }

    public TrackPoint saveTrackPoint(TrackPoint track) {
        // Implement track upload logic here
        trackPointMapper.insertTrackPoint(track);
        return track;
    }

    public List<Track> findByUserId(Long id) {
        // Implement track upload logic here
        return trackMapper.findByUserId(id);
    }
}
